import com.google.gson.Gson;
import com.jr.entity.Province;
import com.jr.service.ProvinceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 省份表
 *
 * @author Snoopy
 * @since 1.0.0 2022-12-31
 */
@Controller
@SuppressWarnings("all")
public class ProvinceController {
    @Autowired
    private ProvinceService provinceService;

    //查询所有的省份数据
    @GetMapping(value = "selectProvinceAll",produces = "text/html;charset=utf-8")
    public @ResponseBody
    String selectJobAll(Integer indexpage){
        Gson gson = new Gson();
        List<Province> provinces = provinceService.selectProvinceAll();
        return gson.toJson(provinces);
    }

}